package cn.kgc.springboot.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author mosin
 * date 2021/12/17
 * @version 1.0
 */
@Controller
@RequestMapping("/log4j")
public class Log4jController {
    //参数  当前类的类 class 对象  打印输出信息时 显示信息输出的位置
    Logger logger = LoggerFactory.getLogger(getClass());

    @ResponseBody
    @RequestMapping("/log1")
    public String testLog1(){
        System.out.println("log4j");
        logger.debug("debug");
        logger.info("info");
        return "ok";
    }
}
